package com.project.service.impl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.ClientBean;
import com.project.bean.DailyBean;
import com.project.mapper.IClientMapper;
import com.project.mapper.IDailyMapper;
import com.project.service.IClientService;
import com.project.service.IDailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;

@Service
@Transactional
public class DailyServiceImpl implements IDailyService {

    @Autowired
    private IDailyMapper mapper;//报错显示，没有写mapper注解

    @Override
    public PageInfo<DailyBean> findByItem(int page, int pageSize, LocalDate startDate, LocalDate endDate) {
        PageHelper.startPage(page,pageSize);
        PageInfo<DailyBean>pageInfo=PageInfo.of(mapper.findByItem(startDate, endDate));
        return pageInfo;
    }
}
